#include "mainwindow.h"
#include "ui_mainwindow.h"
#include"mypushbutton.h"
#include"QTimer"
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->setFixedSize(1020,720);
    MyPushButton *startbtn=new MyPushButton(":/start_pic");
    startbtn->setParent(this);
    startbtn->move(510,360);
    connect(startbtn,&QPushButton::clicked(),[=](){
        startbtn->zoom1();
        startbtn->zoom2();
        QTimer::singleShot(500,this,[=](){
            this->hide();
            //隐藏本窗口后创建游戏界面
            maingame *mainwindow=new maingame;
        });
    })
}

MainWindow::~MainWindow()
{
    delete ui;
}
void MainWindow::paintEvent(QPaintEvent *){
    QPainter painter(this);
    painter.drawPixmap(0,0,800,500,":/start_pic.png");
}
